module ExportHelper
  def export_to_excel record_sets, column_names
    excel = column_names.join(",")
    record_sets.each do |record_set|
      excel.concat("\n#{record_set.get_csv}")
    end
    excel
  end

  def export_to_vcf employee
    vcf = "BEGIN:VCARD\n"
    vcf.concat "VERSION:2.1\n"
    vcf.concat "N:#{employee.Name}\n"
    vcf.concat "FN:#{employee.Name}\n"
    vcf.concat "ORG:#{employee.BusinessUnit}\n"
    vcf.concat "TITLE:#{employee.JobTitle}\n"
    vcf.concat "TEL;WORK;VOICE:#{employee.PhoneWork}\n"
    vcf.concat "TEL;HOME;VOICE:#{}\n"
    vcf.concat "TEL;CELL;VOICE:#{employee.PhoneCell}\n"
    vcf.concat "ADR;WORK:;;#{employee.OfficeAddress};#{employee.City};#{employee.Country}/#{employee.State};#{employee.PostalCode}\n"
    vcf.concat "LABEL;WORK;ENCODING=QUOTED-PRINTABLE:#{employee.OfficeAddress}=0D=0A#{employee.City} & #{employee.PostalCode}\n"
    vcf.concat "URL;WORK:http://www.homeaway.com\n"
    vcf.concat "EMAIL;PREF;INTERNET:#{employee.EMail}\n"
    vcf.concat "REV:20080521T205724Z\n"
    vcf.concat "END:VCARD"
  end
end